<%@page import="java.sql.ResultSet"%>
<%@page import="com.stx.sql.SqlQuery"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎页面</title>
<link href="css/css.css" rel="stylesheet" type="text/css">
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery.validate.js" type="text/javascript"></script>
<script src="localization/messages_cn.js" charset="UTF-8" type="text/javascript"></script>

<script type="text/javascript">
		$().ready(function() {
			//字母数字
			 jQuery.validator.addMethod("alnum", function(value, element) {
			 return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value);
			 }, "只能包括英文字母和数字");
			 
			$("#myform").validate(
			{
				rules: {
					username: 
						{"required":true,
						"alnum":true
					},
					major: "required"
				}
			}
			)
		});
		</script>
</head>
<body>
<%
Boolean isLogin = (Boolean)session.getAttribute("isLogin");
if(isLogin == null){
	response.sendRedirect("login.html");
}
%>
<img src="img/2.jpg" id="bgimage"></img>

<div id="menu" class="transparent_class">
<span id="menuleft"><a href="welcome.jsp"><%=session.getAttribute("username") %></a>已登录</span>

<span id="menuright"><a href="login.jsp">退出</a>|<a href="register2.html">注册</a></span>
</div>
<div id="welcome2">欢迎使用五人行博客 </div>
<div id="welcome" class="transparent_class"><br><br><br><br><br><br><br>
<h2>
<ul id="infomenu">
<li>
<a href="info.jsp?username=<%=session.getAttribute("username") %>">
个人信息
</a>
</li>
<li>
<a href="writeblog.jsp?username=<%=session.getAttribute("username") %>">
添加博文
</a>
</li>
<li>
<a href="readblog.jsp?username=<%=session.getAttribute("username") %>">
查看博文
</a>
</li>
</ul>
</div>
<div id="friends"  class="transparent_class">
<br><br>好友：<br>
<%
SqlQuery sqlQuery=new SqlQuery();
ResultSet rs=sqlQuery.getAllUserSql();
while(rs.next()){
	
	

%>
<hr>
<a href="readblog.jsp?username=<%=rs.getString("username") %>"><h3><%= rs.getString("username") %> </h3></a>
<%} %>
</div>
</body>
</html>